/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.lottery.service.impl;

import iaas.service.impl.BaseServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.wealth.lottery.entity.LotteryNumber;
import com.wealth.lottery.repository.LotteryNumberDao;
import com.wealth.lottery.service.ILotteryNumberService;

/**
 * @author chan
 * @version 1.0
 * @since 1.0
 */
 
@Component
public class LotteryNumberServiceImpl extends BaseServiceImpl<LotteryNumber> implements ILotteryNumberService{

	@Autowired
	private LotteryNumberDao lotteryNumberDao;

	@Override
	public LotteryNumber getByMember(Long memberid, Long activityid) throws Exception {
		List<LotteryNumber> numberList= lotteryNumberDao.findByMemberIdAndActivityId(memberid, activityid);
		if(numberList.size()>0){
			return numberList.get(0);
		}else{
			return null;
		}
	}
	
}
